<%--
  Created by IntelliJ IDEA.
  User: TU
  Date: 2020/2/16
  Time: 15:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>登录界面</title>

    <script>

        function fangfa(){
            var img = document.getElementById("img");
            var date = new Date().getTime();
            img.src = "/day15/checkCodeServlet?"+date;
        }
    </script>

</head>
<body>

    <form action="/day15/loginServlet">

        <table>
            <tr>
                <td>用户名</td>
                <td><input type="text" name="username"> </td>

            </tr>
            <tr>
                <td>密码</td>
                <td><input type="password" name="password"> </td>
            </tr>
            <tr>
                <td>验证码</td>
                <td><input type="text" name="checkCode"> </td>

            </tr>
            <tr>
                <td colspan="2">
                    <img id="img" src="/day15/checkCodeServlet"/>
                    <a href="javaScript:void(0)" onclick="fangfa()">看不清,换一张?</a>
                </td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="登陆"></td>
            </tr>
        </table>

    </form>
    <div>
        <%=request.getAttribute("cc_error") == null ? "" : request.getAttribute("cc_error")%>
    </div>
    <div>
        <%=request.getAttribute("login_error") == null ? "" : request.getAttribute("login_error")%>
    </div>

</body>
</html>
